/*
 * Selling Partner API for Product Type Definitions
 *
 * The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type that you can then use with other Selling Partner APIs, such as the Selling Partner API for Listings Items, the Selling Partner API for Catalog Items, and the Selling Partner API for Feeds (for JSON-based listing feeds).  For more information, see the [Product Type Definitions API Use Case Guide](doc:product-type-api-use-case-guide).
 *
 * The version of the OpenAPI document: 2020-09-01
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = software.amzn.spapi.Client.OpenAPIDateConverter;

namespace software.amzn.spapi.Model.productTypeDefinitions.v2020_09_01
{
    /// <summary>
    /// SchemaLink
    /// </summary>
    [DataContract(Name = "SchemaLink")]
    public partial class SchemaLink : IValidatableObject
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="SchemaLink" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected SchemaLink() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="SchemaLink" /> class.
        /// </summary>
        /// <param name="link">link (required).</param>
        /// <param name="checksum">Checksum hash of the schema (Base64 MD5). Can be used to verify schema contents, identify changes between schema versions, and for caching. (required).</param>
        public SchemaLink(SchemaLinkLink link = default(SchemaLinkLink), string checksum = default(string))
        {
            // to ensure "link" is required (not null)
            if (link == null)
            {
                throw new ArgumentNullException("link is a required property for SchemaLink and cannot be null");
            }
            this.Link = link;
            // to ensure "checksum" is required (not null)
            if (checksum == null)
            {
                throw new ArgumentNullException("checksum is a required property for SchemaLink and cannot be null");
            }
            this.Checksum = checksum;
        }

        /// <summary>
        /// Gets or Sets Link
        /// </summary>
        [DataMember(Name = "link", IsRequired = true, EmitDefaultValue = true)]
        public SchemaLinkLink Link { get; set; }

        /// <summary>
        /// Checksum hash of the schema (Base64 MD5). Can be used to verify schema contents, identify changes between schema versions, and for caching.
        /// </summary>
        /// <value>Checksum hash of the schema (Base64 MD5). Can be used to verify schema contents, identify changes between schema versions, and for caching.</value>
        [DataMember(Name = "checksum", IsRequired = true, EmitDefaultValue = true)]
        public string Checksum { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class SchemaLink {\n");
            sb.Append("  Link: ").Append(Link).Append("\n");
            sb.Append("  Checksum: ").Append(Checksum).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
